<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<div id="app">
<!--    <h2 v-bind:style="{key(属性名):value(属性名)}">{{message}}</h2>-->
<!--    <h2 :style="{fontSize:'50px'}">{{message}}</h2>-->
<!--    <h2 :style="{fontSize:finalSize+'px',color:finalColor,background:finalBackgroundColor}">{{message}}</h2>-->
  {{message}}
<h2 :style="getStyles()">{{message}}</h2>
</div>
<script>
  const app = new Vue({
    el: "#app",
    data:{
      message:"Hello zk I am Vue !",
      finalSize:100,
      finalColor:"red",
      finalBackgroundColor:"blue"
    },
    methods:{
      getStyles(){
        return {fontsize:this.finalSize+'px',color:this.finalColor,background:this.finalBackgroundColor}
      }
    }
  })
</script>
</body>
</html>
